﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mapping.Attributes;
namespace TinyERP.Core.Entity
{
    [NHibernate.Mapping.Attributes.Class(Table = "tbl_user", NameType=typeof(User), Lazy=false)]
    public class User
    {
        [NHibernate.Mapping.Attributes.Id(0, TypeType=typeof(long), Column="col_id", Name="ID")]
        [NHibernate.Mapping.Attributes.Generator(1, Class = "native")]
        public virtual long ID { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "col_username")]
        public virtual string UserName { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "col_password")]
        public virtual string Password { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "col_fullname")]
        public virtual string FullName { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "col_email")]
        public virtual string Email { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "col_birthday")]
        public virtual DateTime Birthday { get; set; }

        [NHibernate.Mapping.Attributes.ManyToOne(Column = "col_user_group_id", Fetch = FetchMode.Join, ClassType=typeof(UserGroup))]
        public virtual UserGroup UserGroup { get; set; }
    }
}
